import QtQuick 2.0

Item {
    id: container
    width: 320
    height: 120

    Rectangle {
        id: rect
        color: "red"
        width: 120
        height: 120

        MouseArea {
            anchors.fill: parent
            onClicked: container.state == 'other' ? container.state = '' : container.state = 'other'
        }
    }

    states: [
        State {
            name: "other"

            PropertyChanges {
                target: rect
                x: 200
            }
        }
    ]

    transitions: [
        Transition {
            NumberAnimation { properties: "x,y" }
        }

    ]
}
